<template>
	<view>
		<!-- 头部导航 -->
		<uni-nav-bar leftWidth='200rpx' rightWidth='200rpx' background-color="#51a0f0" color="#fff" title="登录" />
		<view class="login_back">
			<!-- 登录框 -->
			<view class="login">
				<!-- 登录框头部 -->
				<view class="login_top">
					<text>{{isshow?'验证码登录':"密码登录"}}</text>
					<text @click="text">{{isshow?"密码登录":"验证码登录"}}</text>
				</view>
				<!-- 输入框 -->
				<view class="login_conter" v-if="isshow">
					<uni-easyinput placeholder="请输入手机号" />

					<view class="code">
						<uni-easyinput placeholder="请输入验证码" />
						<text>获取验证码</text>
					</view>
				</view>
				<view class="login_conter" v-else>
					<uni-easyinput placeholder="请输入账户" />

					<view class="code">
						<uni-easyinput placeholder="请输入密码" />

					</view>
				</view>
			</view>
		</view>
		<button type="primary" size="mini" @click="gos()">登录</button>
		<view class="enroll" @click="$utils.go('/pages/enroll/enroll1')">没有账户，立即注册</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isshow: true,
				title: '',
				form: {
					name: ''
				}
			}
		},
		onLoad() {
			this.login()
		},
		methods: {
			gos() {
				uni.switchTab({
					url: '/pages/home/home'
				})
			},
			ret() {
				uni.navigateBack({
					delta: 1
				});
			},
			text() {
				this.isshow = !this.isshow

			},
			async login() {
				let res = await this.$apis.memberLogin({
					"mobile": "13000000000",
					"pass": "123456"

				})
				console.log(res);
				
			}
		},

	}
</script>

<style lang="less" scoped>
	@import url(../../static/css/login.less);
</style>